/**
 * 投标报价单页签
 * @author liuw
 * @date 2019/12/16
 */
define(function () {
    var self,
        app = win.app,
        doc = document,
        layui = win.layui,
        cols = [[
             {field:"GWGI001",title:"招标编号",sort:true}
            ,{field:"GWGC022",title:"项目名称"}
            ,{field:"GWGI002",title:"开标日期",sort:true}
            ,{field:"GWGI010",title:"付款方式"}
            ,{field:"GWGI018",title:"费用合计（元）"}
            ,{field:"GWGI019",title:"总报价（元）"}
        ]],
        pageVue,
        table, form,
        table_where = {
            GWAK001: ''
        }
    ;

    var gwgiBookmark = app.Module.extend({
        init: function () {
            self = this;
            self._super({
                _tag: 'gwgiBookmark'
            }, win);
        },

        initTable: function () {
            layui.use(['table'], function () {
                table = layui.table;
                form = layui.form;
                table.render({
                    elem: app.getByid(doc, 'gwgiBookmark'),
                    url: g_ctxPath + 'crm/gwgi005/getBookmarkData',
                    method: 'post',
                    id: 'gwgiBookmark',
                    size: _layuiConfig.ui_size,
                    autoSort: false, //禁用前端自动排序
                    height: 'full-10',
                    cols: cols,
                    loading: true,
                    page: true,
                    where: table_where,
                    done: function (res, curr, count) {

                    }
                });

            });
        },

        tableReload: function (listData) {
            self._reloadTable({id: 'gwgiBookmark', where: table_where});
        },

        _ready: function () {
            table = layui.table;
            pageVue = new Vue({
                el: '#gwgiBookmark',
                data: {},
                methods: {
                    cancle: function () {
                        self._closeTpl();
                    }

                },
                created: function () {
                    self._setEleIsReady('gwgiBookmark');
                }
            });
            self.initTable();
        },
        _lazy: function () {
            this._super();
        }
    });

    return new gwgiBookmark();

})
;